home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / prog / atari / c / mail110 / showix.c < prev    next >
C/C++ Source or Header  |  1994-02-08  |  2KB  |  90 lines

  1. //=========================================================
  2. //
  3. //    showix.c
  4. //
  5. //    void showix(int from_msg, int cur_msg)
  6. //
  7. //    Show the first(next) 16 message headers from the message
  8. //    index.
  9. //
  10. //=========================================================
  11.  
  12. // $Id: showix.c,v 1.2 1994/02/08 23:33:54 gbj Exp user $
  13.  
  14. /*
  15. $Log: showix.c,v $
  16.  * Revision 1.2  1994/02/08  23:33:54  gbj
  17.  * First public release.
  18.  *
  19.  * Revision 1.1  1994/02/08  03:16:14  gbj
  20.  * Initial revision
  21.  *
  22. */
  23.  
  24. #include "mailer.h"
  25.  
  26. #define RVSON    printf("\033p")
  27. #define RVSOFF    printf("\033q")
  28.  
  29. void showix(int from_msg, int cur_msg)
  30. {
  31.     int mno;
  32.     char buf[81];
  33.     char buf1[10];
  34.     char msender[30];
  35.     char mdate[13];
  36.     char msubject[28];
  37.     int rflag, dflag;
  38.     
  39.     
  40.     if (maxmsgno+1 == 1)
  41.         printf("\n\n 1 Message\n\n");
  42.     else
  43.         printf("\n\n %d Messages\n\n", maxmsgno+1);
  44.     printf("    Msg <-----------Sender----------> <---Date---> ");
  45.     printf("<---------Subject---------->\n\n");
  46.     mno=from_msg;
  47.     while (mno < from_msg+16 && mno <= maxmsgno)
  48.     {
  49.         *buf='\0';
  50.         strncpy(msender, mailix[mno].sender, 29);
  51.         msender[29]='\0';
  52.         strncpy(mdate, mailix[mno].msgdate, 12);
  53.         mdate[12]='\0';
  54.         strncpy(msubject, mailix[mno].subject, 27);
  55.         msubject[27]='\0';
  56.         rflag=mailix[mno].rflag;
  57.         dflag=mailix[mno].dflag;
  58.         if (mno == cur_msg)
  59.             strcpy(buf, ">");
  60.         else
  61.             strcpy(buf, " ");
  62.         if (rflag)
  63.             strcat(buf, "Y");
  64.         else
  65.             strcat(buf, " ");
  66.         if (dflag)
  67.             strcat(buf, "D");
  68.         else
  69.             strcat(buf, " ");
  70.         strcat(buf, " ");
  71.         sprintf(buf1, "%03d", mno);
  72.         strcat(buf, buf1);
  73.         strcat(buf, " ");
  74.         strcat(buf, msender);
  75.         strcat(buf, " ");
  76.         strcat(buf, mdate);
  77.         strcat(buf, " ");
  78.         strcat(buf, msubject);
  79.         if (*buf == '>')
  80.             RVSON;
  81.         printf("%-79.79s", buf);
  82.         if (*buf == '>')
  83.             RVSOFF;
  84.         printf("\n");
  85.         mno++;
  86.     }
  87.     printf("\n");
  88.     return;
  89. }
  90.